Carbon


NavPreviewProcPtr

Header: Navigation.h Carbon status: Supported

Displays custom file previews.

typedef Boolean(* NavPreviewProcPtr) (
    NavCBRecPtr callBackParms, 
    void *callBackUD
);

You would declare your function like this if you were to name it MyNavPreviewCallback:

Boolean MyNavPreviewCallback (
    NavCBRecPtr callBackParms, 
    void *callBackUD
);
Parameter descriptions
callBackParms

A pointer to a structure of type NavCBRec. Navigation Services uses this structure to provide data needed for your function to draw the preview.

callBackUD

A pointer to a value set by your application when it calls a Navigation Services function such as NavGetFile. When Navigation Services calls your preview function, the callBackUD value is passed back to your application in this parameter.

function result

A Boolean value. Your application returns true if your preview function successfully draws the custom file preview. If your preview function returns false, Navigation Services displays the preview if the file contains a valid 'pnot' resource. If your preview function returns false and a 'pnot' resource is not available, Navigation Services displays a blank preview area. For more information, see “Drawing Custom Previews”.

DISCUSSION

Register your preview function by passing the resulting Universal Procedure Pointer (UPP) in the previewProc parameter of a Navigation Services function, such as NavGetFile. You obtain this UPP by calling the macro NewNavPreviewProc and passing a pointer to your preview-drawing function. When the user selects a file, Navigation Services calls your preview-drawing function. Your preview function, in turn, calls the function NavCustomControl to determine if the preview area is visible and, if so, what its dimensions are. For more information, see “Drawing Custom Previews”.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)